package cn.wj.school.common.dto;

import cn.wj.school.common.enums.MsgType;
import lombok.Data;

import java.io.Serializable;

/**
 * @Author: yueding
 * @Description: 消息基类
 * @Date: Created in 15:28 2018/12/27
 * @Modified By: yueding Copyright(c) cai-inc.com
 */
@Data
public abstract class BaseMsg extends ByteBufBean implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 获取消息类型
     * @return
     */
    abstract public MsgType getMsgType();

    /**
     * 是否开启gzip压缩(默认关闭) 消息体数据大的时候才开启，非常小的包压缩后体积反而变大，而且耗时
     */
    public boolean isUseCompression() {
        return false;
    }
}
